<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="/callimachus/template.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:calli="http://callimachusproject.org/rdf/2009/framework#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:skos="http://www.w3.org/2004/02/skos/core#"
    xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
    xmlns:gr="http://purl.org/goodrelations/v1#"
    xmlns:directory="http://dir.w3.org/rdf/2012/directory/">
<head>
	<title resource="?this">{rdfs:label}</title>
</head>
<body resource="?this">
    <h1 property="gr:description" />
	<form resource="?this" typeof="gr:ProductOrServiceModel" method="POST" enctype="application/sparql-update">
		<div class="control-group">
			<label for="label" class="control-label">Label</label>
            <div class="controls">
			    <input type="text" id="label" required="required" value="{rdfs:label}" />
            </div>
		</div>
		<div class="control-group">
			<label for="web-page" class="control-label">Web page</label>
            <div class="controls">
			    <input type="url" id="web-page" placeholder="Web page with more detail" value="{foaf:page}" />
            </div>
		</div>
    	<div class="control-group" dropzone="link s:text/uri-list" ondrop="return calli.insertResource(event)">
			<label class="control-label">Depiction <a href="{gr:hasManufacturer}?create=/callimachus/Image" title="Upload"
    				onclick="return calli.createResource(event)" class="ui-icon ui-icon-newwin" /></label>
			<div rel="foaf:depiction" class="controls">
                <span resource="?depiction" typeof="foaf:Image" class="ui-state-highlight ui-corner-all">
    				<img src="{?depiction}" style="max-height:10em;max-width:10em" />
                </span>
			</div>
		</div>
		<div class="control-group">
			<label for="comment" class="control-label">Comment</label>
            <div class="controls">
			    <textarea id="comment" class="auto-expand">{rdfs:comment}</textarea>
            </div>
		</div>
        <div class="form-actions">
    		<button id="save" type="submit" class="btn btn-primary">Save</button>
    		<button id="cancel" type="button" onclick="location.replace('?view')" class="btn">Cancel</button>
    		<button id="delete" type="button" onclick="calli.deleteResource(event, '{gr:hasManufacturer}')" class="btn btn-danger">Delete</button>
        </div>
	</form>
</body>
</html>
